/*
     raw os - Copyright (C)  Lingjun Chen(jorya_txj).

    This file is part of raw os.

    raw os is free software; you can redistribute it it under the terms of the 
    GNU General Public License as published by the Free Software Foundation; 
    either version 3 of the License, or  (at your option) any later version.

    raw os is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
    without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the GNU General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program. if not, write email to jorya.txj@gmail.com
                                      ---

    A special exception to the LGPL can be applied should you wish to distribute
    a combined work that includes raw os, without being obliged to provide
    the source code for any proprietary components. See the file exception.txt
    for full details of how and when the exception can be applied.
*/
/* 2012/10/08	   DM9K_LWIP.h 
*		   by Nie Qiang <sddzycnq@gmail.com>
*/



#ifndef __DM9K_LWIP_H 
#define __DM9K_LWIP_H 
#include "raw_api.h"

//*---------------------------------------- stuctrue and macro-----------------------------------------

#define DM9K_ID		0x90000A46

#define DM9K_NCR             0x00
#define DM9K_NSR             0x01
#define DM9K_TCR             0x02
#define DM9K_TSR1            0x03
#define DM9K_TSR2            0x04
#define DM9K_RCR             0x05
#define DM9K_RSR             0x06
#define DM9K_ROCR            0x07
#define DM9K_BPTR            0x08
#define DM9K_FCTR            0x09
#define DM9K_FCR             0x0A
#define DM9K_EPCR            0x0B
#define DM9K_EPAR            0x0C
#define DM9K_EPDRL           0x0D
#define DM9K_EPDRH           0x0E
#define DM9K_WCR             0x0F

#define DM9K_PAR             0x10
#define DM9K_MAR             0x16

#define DM9K_GPCR			 0x1e
#define DM9K_GPR			 0x1f
#define DM9K_TRPAL           0x22
#define DM9K_TRPAH           0x23
#define DM9K_RWPAL           0x24
#define DM9K_RWPAH           0x25

#define DM9K_VIDL            0x28
#define DM9K_VIDH            0x29
#define DM9K_PIDL            0x2A
#define DM9K_PIDH            0x2B

#define DM9K_CHIPR           0x2C
#define DM9K_SMCR            0x2F

#define DM9K_MRCMDX          0xF0
#define DM9K_MRCMD           0xF2
#define DM9K_MRRL            0xF4
#define DM9K_MRRH            0xF5
#define DM9K_MWCMDX          0xF6
#define DM9K_MWCMD           0xF8
#define DM9K_MWRL            0xFA
#define DM9K_MWRH            0xFB
#define DM9K_TXPLL           0xFC
#define DM9K_TXPLH           0xFD
#define DM9K_ISR             0xFE
#define DM9K_IMR             0xFF

//*-------------------------------------------- function prototype-----------------------------------------
extern void DM9K_init(void);
extern void DM9K_sendPcket(RAW_U8 *datas, RAW_U32 length);
extern RAW_U32 DM9K_receivepacket(RAW_U8 *datas);
 
#endif 

